feat(env): Detect Linux package manager (apt-get/dnf) when installing prerequisites - #1021
Open
rkntan wants to merge 1 commit into
Open
feat(env): Detect Linux package manager (apt-get/dnf) when installing prerequisites#1021rkntan wants to merge 1 commit into
rkntan wants to merge 1 commit into
Conversation
Previously `./build.py install` unconditionally used apt-get on Linux, which fails on non-Debian distributions such as Fedora. Now the script detects the available package manager (apt-get or dnf) and uses the matching prerequisite install command. The dnf package list follows the ESP-IDF Get Started guide for Fedora. If no supported package manager is found, it falls back to the previous apt-get behavior with a warning. Closes espressif#1010
Collaborator
|
thanks for the feedback! will fix it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #1010
./build.py installcurrently assumes a Debian-based system and unconditionally runssudo apt-get install ...on Linux. On distributions without apt-get (e.g. Fedora), the install step fails:Changes
detect_linux_package_manager()helper that usesshutil.which()to find the first available supported package manager (apt-get,dnf).dnfis detected, prerequisites are installed with the package list from the ESP-IDF Get Started guide for Fedora (libffi/openssldev headers are not needed there per IDF docs;libusbxreplaceslibusb-1.0-0).apt-getbehavior with a warning, so existing behavior on unknown systems is unchanged (the existing error message still prints the exact command to run manually).Testing
detect_linux_package_manager()returnsapt-get/dnf/Nonecorrectly depending on which binaries are present.Credit to @ChaiJahan for reporting the issue and proposing the initial approach.